#!/bin/perl  
package Employee; 
sub  new{ 
my  $class = shift; 
$worker={Name=>undef,  
Salary=>undef,  
};  
bless($worker,  $class); 
return  $worker;} 
sub DESTROY{ 
my  $self = shift; 
print "$self->{Name}\n" ; 
delete $self->{Name}; # remove the (object); 
print "Hash Name entry has been destroyed. Bailing out.\n" if ( ! exists 
$self->{Name});  
}  
package main; 
$empref = new Employee; # create the object 
$empref->{Name}=  "Dan Savage" ; 
$empref->{Salary}=10000;  
print "Name is $empref->{Name}.\n" ; 
print "Salary is $empref->{Salary}.\n" ; 
